package com.oauth.exception;

import com.oauth.error.ErrorModel;
import org.apache.oltu.oauth2.common.exception.OAuthProblemException;
import org.springframework.hateoas.PagedResources;

/**
 * Created by dell on 2016/10/9.
 */
public class OAuthErrorException extends OAuthProblemException {

    private ErrorModel errorModel;

    protected OAuthErrorException(String error) {
        super(error);
    }

    public OAuthErrorException(ErrorModel errorModel){
        super(errorModel.getCode(),errorModel.getMsg());
    }

    public static OAuthProblemException error(ErrorModel errorModel) {
        return new OAuthErrorException(errorModel);
    }
}
